home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / params / function.bas < prev    next >
BASIC Source File  |  1994-10-16  |  940b  |  35 lines

  1. Option Explicit
  2. '
  3. ' Common Subs/Functions
  4. '
  5.   '
  6.   ' Related Global Constants for this Module
  7.   '
  8.     '
  9.     '  Global Constants for PlaceDialog
  10.     '
  11.       Global Const DLG_STANDARD = 0
  12.       Global Const DLG_CENTERED = 1
  13.  
  14. Sub CenterForm (frm As Form)
  15.   '
  16.   ' Centers specified form on the screen
  17.   '
  18.   frm.Move (screen.Width / 2) - (frm.Width / 2), (screen.Height / 2) - (frm.Height / 2)
  19. End Sub
  20.  
  21. Sub PlaceDialog (frmSource As Form, frmDialog As Form, iPos As Integer)
  22.   '
  23.   ' Places a dialog form in relation to the source form
  24.   '
  25.   Select Case iPos
  26.     Case DLG_STANDARD
  27.       frmDialog.Move frmSource.Left + 300, frmSource.Top + 300
  28.     Case DLG_CENTERED
  29.       frmDialog.Move frmSource.Left + ((frmSource.Width / 2) - (frmDialog.Width / 2)), frmSource.Top + ((frmSource.Height / 2) - (frmDialog.Height / 2))
  30.     Case Else
  31.       Debug.Print "Invalid Parameter sent to PlaceDialog"
  32.   End Select
  33. End Sub
  34.  
  35.